In the packaging of integrated circuits, a plurality of device dies may be bonded on an interposer wafer, which may include a plurality of interposers disposed therein. After bonding the device dies, an underfill is dispensed to fill gaps between the device dies and the interposer wafer. A curing process may then be performed to cure the underfill. A molding compound can be applied to encapsulate the device dies. The resulting interposer wafer and top dies may then be sawed apart into a plurality of packages, with the packages including exposed electrical connectors (e.g., solder balls). The packages are then bonded to package substrates or printed circuit boards.